<template>
  <div class="clock">
    <div class='bestSell'>
      <div class="selltop">
        <h3>每日一书</h3>
        <p>
          <span>共打卡
            <span>{{total}}</span>天</span>
        </p>
      </div>
      <div class="weeks">
        <ul>
          <li>
            <span class="week">周一</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>
          <li>
            <span class="week">周二</span>
            <span class="day">1</span>
            <span class="dots"></span>
          </li>

        </ul>
      </div>
    </div>
    <div class="clockBook">
      <div class='shareTitle'>
        <p>
          <span>09.29</span>
          <span>今日推荐</span>
        </p>
        <i-icon type="send" size="24" color="#666" class="cions" />
      </div>
      <div class="mainImg">
        <img src="../../../static/share/share.jpg" alt="">
        <p class="description">充满希望的旅途胜过终点的到达.</p>
      </div>
    </div>
    <div class="mask" @click='closeModal' v-if='showModal'>
      <div class="bg">
        <div class="clockBook ">
          <div class='shareTitle'>
            <p>
              <span>09.29</span>
              <span>今日推荐</span>
            </p>
            <div @click="closeModal">
              <i-icon type="close" size="24" color="#666" class="cions" />
            </div>
          </div>
          <div class="mainImg">
            <img src="../../../static/share/share.jpg" alt="" class="imgs">
            <p class="description">充满希望的旅途胜过终点的到达.</p>
            <span class="username">用户名</span>
            <span class="clocked">已打卡</span>
            <div class="erweima">此处放二维码</div>
          </div>

        </div>
      </div>
      <button @click="handleClick" class="saveImg">保存图片分享</button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      total: 0,
      showModal: true
    }
  },
  mounted() {
    this.$http.post('/singin/query', { page: 1, pageSize: 7 }).then(res => {
      this.total = res.data.total
    })
  },
  methods: {
    closeModal() {
      this.showModal = false
    }
  }
}
</script>
<style lang="scss" scoped>
.clock {
  padding: 30rpx 18rpx 18rpx 18rpx;
  .bestSell {
    margin-top: 18rpx;
    padding: 18rpx;
    background: #fff;
    .selltop {
      display: flex;
      justify-content: space-between;

      h3 {
        font-size: 36rpx;
        color: #000;
        font-weight: 700;
        border-left: 4px solid #ca8c5a;
        padding-left: 8px;
      }
      p {
        span {
          font-size: 28rpx;
          color: #9f9f9f;
        }
      }
    }
    .weeks {
      width: 100%;
      overflow-x: scroll;
      ul {
        width: 200%;
        overflow: hidden;
        li {
          width: 80rpx;
          height: 100rpx;
          float: left;
          position: relative;

          .week {
            font-size: 28rpx;
            color: #777;
            display: inline-block;
            width: 100%;
            text-align: center;
          }
          .day {
            display: block;
            width: 100%;
            font-size: 20rpx;
            color: #999;
            text-align: center;
          }
          .dots {
            position: absolute;
            width: 10rpx;
            height: 10rpx;
            background: #666;
            border-radius: 50%;

            left: 50%;
            bottom: 10rpx;
            transform: translateX(-50%);
          }
        }
      }
    }
  }
}
.clockBook {
  height: 540rpx;
  width: 100%;
  box-shadow: 1px 0 10px #e8e8e8;
  .shareTitle {
    display: flex;
    width: 640rpx;
    height: 90rpx;
    margin: 0 auto;
    justify-content: space-between;
    p {
      font-size: 26rpx;
      line-height: 90rpx;
    }
    .cions {
      margin-top: 20rpx;
    }
  }
  .mainImg {
    img {
      width: 640rpx;
      height: 308rpx;
      display: block;
      margin: 0 auto;
    }
    .description {
      font-size: 32rpx;
      color: #666;
      width: 640rpx;
      padding-top: 30rpx;
      margin: 0 auto;
    }
  }
}
.mask {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  padding: 0 18rpx;
  box-sizing: border-box;
  .bg {
    background: #fff;
    position: absolute;
    border-radius: 10px;
    width: 714rpx;
    height: 726rpx;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -40%);
    .clockBook {
      box-shadow: 0 0 0 0;
      .mainImg {
        position: relative;
        img {
          height: 425rpx;
        }
        p {
          padding-top: 90rpx;
        }
        span {
          font-size: 30rpx;
          color: #333;
          &.username {
            margin-left: 36rpx;
            margin-right: 10rpx;
          }
          &.clocked {
            color: #666;
          }
        }
        .erweima {
          width: 140rpx;
          height: 140rpx;
          background: deepskyblue;
          line-height: 140rpx;
          text-align: center;
          position: absolute;
          right: 36rpx;
          bottom: 10rpx;
          border-radius: 50%;
          font-size: 20rpx;
        }
      }
    }
  }
}
.saveImg {
  position: fixed;
  left: 50%;
  bottom: 60rpx;
  transform: translateX(-50%);
  width: 714rpx;
  border-radius: 10px;
  background: #c78550 !important;
  color: #fff;
}
</style>

